#!/usr/bin/env python

import json

from tornado import httpclient

cli = httpclient.HTTPClient()
res = cli.fetch('https://api.huobi.pro/v1/settings/common/market-symbols')
message = json.loads(res.body)

symbols = {}
for item in message['data']:
  key = '%s%s' % (item['bc'], item['qc'])
  val = '\'%s\', \'%s\', %d, %d' % (
      item['bc'],
      item['qc'],
      item['pp'],
      item['ap'],
  )
  symbols[key] = val

for key in sorted(symbols.keys()):
  print('    \'%s\': HuobiSymbol(%s),' % (key, symbols[key]))
